Skip to content

fix(comments): dismiss mention notifications and clear unread badge when viewed in activity sidebar#60617

Open
miaulalala wants to merge 1 commit into
masterfrom
fix/2531/comments-not-marked-read
Open

fix(comments): dismiss mention notifications and clear unread badge when viewed in activity sidebar#60617
miaulalala wants to merge 1 commit into
masterfrom
fix/2531/comments-not-marked-read

Conversation

@miaulalala
Copy link
Copy Markdown
Contributor

Summary

  • When comments are loaded via the Activity sidebar integration, call markCommentsAsRead() (DAV PROPPATCH) so the file-row unread comment bubble clears after viewing
  • Update the frontend file node immediately via node.update({ 'comments-unread': 0 }) so the bubble disappears without waiting for a PROPFIND refresh
  • Add a new DELETE /apps/comments/notifications/{id} endpoint that marks a comments/comment/mention notification as processed without redirecting
  • Call that endpoint for each comment that mentions the current user when the Activity sidebar loads, so the notification bell clears without the user having to navigate via the notification link

Without this, opening the Activity sidebar for a file never triggered a DAV read-marker update, so the unread comment bubble persisted in the Files list even after viewing all comments. The notification bell also kept showing comment-mention notifications after the user had already read them in the sidebar.

Fixes: nextcloud/activity#2531

Test plan

  • With the Activity app enabled, open a file's Activity sidebar that has unread comments — the chat bubble on the file row should disappear after the sidebar loads
  • If you are @mentioned in a comment and open the Activity sidebar for that file, the notification bell entry for the mention should be cleared
  • Confirm the new DELETE /apps/comments/notifications/{id} endpoint returns 200 for a valid comment id, 403 if not logged in, 404 for unknown ids
  • Run existing PHP unit tests: NOCOVERAGE=1 ./autotest.sh sqlite apps/comments/tests/Unit/Controller/NotificationsTest.php
  • Cypress tests: cypress/e2e/comments/comments-unread.cy.ts

🤖 Generated with Claude Code

… in activity sidebar

Add a `DELETE /notifications/dismiss/{id}` endpoint to the comments
NotificationsController that marks the `comments/comment/mention`
notification as processed without redirecting.

When comments are loaded in the activity sidebar, the frontend calls
this endpoint for any comment that mentions the current user, so the
notification is cleared from the bell without requiring the user to
navigate via the notification link.

Fixes: nextcloud/activity#2531

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
@miaulalala miaulalala force-pushed the fix/2531/comments-not-marked-read branch from 4142aee to 964ba1c Compare May 20, 2026 15:59
@miaulalala
Copy link
Copy Markdown
Contributor Author

/backport to stable34

@miaulalala
Copy link
Copy Markdown
Contributor Author

/backport to stable33

miaulalala added a commit that referenced this pull request May 20, 2026
…ivity sidebar

Backport of #60617 to stable32.

When the Activity app integration is active, comments are loaded in the
Activity sidebar instead of the Comments tab. The read marker and mention
notification dismissal were never triggered in this path, leaving the
unread bubble in the file list and keeping mention notifications active.

Also adds a new DELETE /notifications/{id} endpoint to dismiss individual
mention notifications by comment ID.

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
miaulalala added a commit that referenced this pull request May 20, 2026
…hen viewed in activity sidebar

Backport of #60617 for stable31.

When comments are loaded via the Activity sidebar integration, call
markCommentsAsRead() so the file-row unread comment bubble clears after
viewing. Also add a DELETE /notifications/{id} endpoint and call it for
each comment that mentions the current user so the notification bell
clears without navigating via the notification link.

Fixes: nextcloud/activity#2531

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
miaulalala added a commit that referenced this pull request May 20, 2026
…ivity sidebar

Backport of #60617 to stable32.

When the Activity app integration is active, comments are loaded in the
Activity sidebar instead of the Comments tab. The read marker and mention
notification dismissal were never triggered in this path, leaving the
unread bubble in the file list and keeping mention notifications active.

Also adds a new DELETE /notifications/{id} endpoint to dismiss individual
mention notifications by comment ID.

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments don't get marked as read

1 participant